<?php 
header("Content-type:text/html;charset=utf-8");
$name=$_POST['email'];
    include './public/ConnectMysql.php';
    $str_sql="SELECT username,`password` FROM ru_admin WHERE 1=1";
    $query_result=$conn->query($str_sql);
    if ($query_result->num_rows>0)
    {
        while ($row=$query_result->fetch_assoc()) {
            echo  $row["username"];
            if ($name==$row["username"])
            {
                echo "欢迎你".$name;
                $expire=time()+60*60*24*30;
                setcookie('Username', $name, $expire);
                header("Location:admin-index.php");
            }
            break
            ;
        }
        
    }
?>